package com.dyz.leetcode._12_linkedList;

import com.dyz.leetcode.ListNode;

public class _237_deleteNode {
    public void deleteNode(ListNode node) {
        ListNode pre = null;
        while (node!=null){
            ListNode next = node.next;
            if(next!=null){
                node.val=next.val ;
            }else {
                pre.next = null;
            }
            pre = node;
            node = node.next;
        }

    }
}
